﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Silverlight.Testing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ObjectDirectory;

namespace t_ObjectDirectory
{
    [TestClass]
    public class t_ObjectPathManagerBoxedObjects
    {
        public class MyDoubleClass
        {
            public double Dude { get; set; }
        }

        [TestMethod]
        public void TestPathToNonObject()
        {
            MyDoubleClass dc = new MyDoubleClass() { Dude = 2.5 };

            ObjectPathManager mgr = new ObjectPathManager();
            Assert.AreEqual(2.5, mgr.FindObjectFromPath(dc, "Dude"), "Didn't get back the right thing!");
        }

#if false
        [TestMethod]
        public void TestPathToNonObjectChanged()
        {
            MyDoubleClass dc = new MyDoubleClass() { Dude = 2.5 };

            ObjectPathManager mgr = new ObjectPathManager();
            object result = mgr.FindObjectFromPath(dc, "Dude");
            dc.Dude = 3.5;
            Assert.AreEqual(3.5, (double) result, "Value didn't track");
        }
#endif
    }
}